#ifndef RTE_KB1283_N2NCLASS_H
#define RTE_KB1283_N2NCLASS_H


#include <smodule.h>
#include <cstring>

class n2nClass : public smodule {
    int thread();

    int run(uint32_t tick) final;

    int begin(uint32_t tick) final;


#ifdef __PLATFORMIO_BUILD_DEBUG__
    int dev_test(uint32_t tick) final;
#endif

    static void thd_loop(void *arg);

    static int keep_on_running;
#ifndef THIS_IS_BOOTLOADER
    int diag(uint32_t tick) final;
    const char *name() override { return "n2n"; }

    const pb_module_type type() override { return pb_module_type_N2N; }

    const int data_len() override { return sizeof(data); }

    int read_data(u8 *data) override {
        std::memcpy(data, &this->data, sizeof(data));
        return sizeof(data);
    }
#endif
    struct {
    } data;
};

extern n2nClass n2nClient;


#endif //RTE_KB1283_N2NCLASS_H
